import 'dart:ffi';

import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:getx_simple_code/pages/diovc/pojo/dishesEntity.dart';

import 'logic.dart';

class DiovcdetailPage extends GetView<DiovcdetailLogic> {
  final Records item = Records.fromJson(Get.arguments);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: Text('菜品详情'),
        ),
        body: Center(
          child: Container(
            margin: EdgeInsets.only(top: 30),
            child: Column(
              children: [
                Text('菜品名:${item.name}',style: TextStyle(color: Colors.red, fontSize: 30),),
                Text('分类:${item.categoryName}',style: TextStyle(color: Colors.orange, fontSize: 25),),
                ElevatedButton(
                    onPressed: () {
                      controller.deleteDishes(item.id.toString());
                    },
                    child: Text("删除菜品")),
              ],
            ),
          ),
        )
    );
  }
}
